#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int check(int x)
{
	int k = 0;
	while (x)
	{
		x /= 10;
		k++;
	}
	return k;
}

void Print(int m)
{
	for (int i = 0; i < m; i++)
	{
		printf("0");
	}
}

int main()
{
	int row = 0, col = 0, i = 0, j = 0, num = 1, m = 0;
	scanf("%d%d", &row, &col);
	int k = check(row * col);
	for (i = 0; i < row; i++)
	{
		for (j = 0; j < col; j++)
		{
			m = k - check(num);
			Print(m);
			printf("%d ", num);
			num++;
		}
		printf("\n");
	}
	return 0;
}